xen: arm: improve handling of system with non-contiguous RAM regions
authorIan Campbell <ian.campbell@citrix.com>
Mon, 2 Dec 2013 14:39:05 +0000 (14:39 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 6 Dec 2013 11:47:46 +0000 (11:47 +0000)
commit2d02b05c77fc5e7c76bf6f112db84bbaa44fdcb5
tree6012462b1fbf0bc5749b12401a2dd7feeec4cf7d
parentb490724477f9215bb7a0a3e3b1ebe01e0fc20c17
xen: arm: improve handling of system with non-contiguous RAM regions

arm32 currently only makes use of memory which is contiguous with the first
bank. On the Midway platform this means that we only use 4GB of the 8GB
available.

Change things to make use of non-contiguous memory regions with the
restriction that we require that at least half of the total span of the RAM
addresses contain RAM. The frametable is currently not sparse and so this
restriction avoids problems with allocating enormous amounts of memory for the
frametable to cover holes in the address space and exhausting the actual RAM.

50% is arguably too restrictive. 4GB of RAM requires 32MB of frametable on
arm32 and 56M on arm64, so we could probably cope with a lower ratio of actual
RAM. However half is nice and conservative.

arm64 currently uses all banks without regard for the size of the frametable,
which I have observed causing problems on models. Implement that same
restriction as arm32 there.

Long term we should look at moving to a pfn compression based scheme similar
to x86, which removes the holes from the frametable.

There were some bogus/outdated comments scattered around this code which I
have removed.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Tested-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Julien Grall <julien.grall@linaro.org>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>
xen/arch/arm/setup.c